package com.sdhs.system.syncdata.common;

import lombok.Getter;

/**
 * @author zhangmy
 * @date 2022/9/2014:10
 * @Description:属性值字段是否必填
 */
public enum RoleRequiredEnum {
    ID("roleId", true),
    NAME("roleName", true),
    ROLEKEY("roleKey",true),
//    REMARK("remark", false),
//    HASGROUP("hasGroup", false),
//    HASSYSTEM("hasSystem", false),
    STATUS("status", false);




    @Getter
    final String fieldName;
    @Getter
    final boolean required;

    RoleRequiredEnum(String fieldName, boolean required) {
        this.fieldName = fieldName;
        this.required = required;
    }

    public static String getValue(String name) {
        RoleRequiredEnum[] reEnum = values();
        for (RoleRequiredEnum type : reEnum) {
            if (name.equals(type.fieldName)) {
                return String.valueOf(type.required);
            }
        }
        return null;
    }
}
